<div class="head" ng-if="isedit">
    <span ng-if="!title">
        <span ng-if="data._rev">编辑</span>
        <span ng-if="!data._rev">添加</span>
    </span>
    <span ng-if="title" ng-bind=title></span>
</div>
<div class="head" ng-if="!isedit">
    详情
</div>
<div class="body" elementid="body">
    <field -if="!isedit" ng-repeat="f in fields" readonly -src="[f,data]"></field>
    <field -else ng-repeat="f in fields" -src="[f,data]"></field>
</div>
<yscroll></yscroll>
<div class="foot" ng-if="isedit">
    <btn ng-if=save.ing>正在保存</btn>
    <btn ng-else ng-click="login(save)" disabled.=!valid>确定</btn>
    <btn type="white" ng-click="!has_rev?close():(isedit=false)">取消</btn>
</div>
<div class="foot" -else>
    <btn ng-if="remove.ing" type="dark">正在删除</btn>
    <btn ng-if="!remove.ing&&has_rev" ng-click="login(remove)" type_="remove.confirm?'dark':'danger'">
        <span ng-if="remove.confirm">确认</span>删除
    </btn>
    <btn ng-if=save.ing>正在保存</btn>
    <btn ng-click="isedit=true">编辑</btn>
    <btn type="white" ng-if="close.ing">取消</btn>
    <btn type="white" ng-if="!close.ing" ng-click="close.ing=true,close(-1)">取消</btn>
</div>